<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var year=prompt("请您输入年份:");
			var runyear=year%4==0&&year%100!=0||year%400==0;
			for(var i=1;i<=12;i++){
				if(i==4||i==6||i==9||i==11){
					document.write(i+"月有30天<br />");
				}else if(i==2){
					if(runyear){
						document.write(i+"月有29天<br />");
					}else{
						document.write(i+"月有28天<br />");
					}
				}else{
					document.write(i+"月有31天<br />");
				}
			}
		</script>
	</body>
</html>
